package com.ldr.custom.spring.demo.action;

import com.ldr.custom.spring.annotation.GPAutowried;
import com.ldr.custom.spring.annotation.GPController;
import com.ldr.custom.spring.annotation.GPRequestMapping;
import com.ldr.custom.spring.annotation.GPRequestParam;
import com.ldr.custom.spring.demo.service.OrderService;
import com.ldr.custom.spring.v2.webmvc.GPModelAndView;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.*;

@GPController
@GPRequestMapping("/dateCenter")
public class DateCenterController {

    @GPAutowried
    private OrderService orderService;


    @GPRequestMapping("query*")
    public GPModelAndView query(HttpServletRequest request, HttpServletResponse response, @GPRequestParam(value = "id") Integer id) {

        String orderNum = orderService.queryById(id);

        Map<String,Object> model=new HashMap<>();

        model.put("name","张三");
        model.put("describe","今天学习模仿SpringMVC");
        model.put("time",new Date());

        return new GPModelAndView("first.html",model);
    }

    @GPRequestMapping("querylist")
    public GPModelAndView querylist(@GPRequestParam("ids") Long[] ids){
        List<Long> longs = Arrays.asList(ids);
        return null;
    }
}
